package com.xiangyang.pos.bean;

import android.util.Log;

import com.google.gson.Gson;

import java.util.List;

/**
 * Created by Administrator on 2017/8/17 0017.
 *
 * 用户购买记录数据源
 *
 * @author YeDalin
 *
 */

public class UserShoppingDataBean {

    private int status;
    private String msg;
//    private List<UserShoppingData> data;

    private UserShopData data;

    public UserShopData getData() {
        return data;
    }

    public void setData(UserShopData data) {
        this.data = data;
    }

    private String userId;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public class UserShoppingData{

        private String create_time;
        private String goods_name;
        private float goods_price;
        private int goods_num;

        public String getCreate_time() {
            return create_time;
        }

        public void setCreate_time(String create_time) {
            this.create_time = create_time;
        }

        public String getGoods_name() {
            return goods_name;
        }

        public void setGoods_name(String goods_name) {
            this.goods_name = goods_name;
        }

        public float getGoods_price() {
            return goods_price;
        }

        public void setGoods_price(float goods_price) {
            this.goods_price = goods_price;
        }

        public int getGoods_num() {
            return goods_num;
        }

        public void setGoods_num(int goods_num) {
            this.goods_num = goods_num;
        }
    }


    public class UserShopData{

        private String content;

        public List<UserOrderData> getContent() {

            String str="{\"list\":"+content+"}";
            Log.e("xxxx","josnData= "+str);

            Gson gson=new Gson();
            GsonData data=gson.fromJson(str,GsonData.class);

            return data.getList();
        }

        public void setContent(String content) {
            this.content = content;
        }
    }

    public class GsonData{
        private List<UserOrderData> list;

        public List<UserOrderData> getList() {
            return list;
        }

        public void setList(List<UserOrderData> list) {
            this.list = list;
        }
    }


    public class UserOrderData{
        private String id;
        private String address;
        private String title;
        private String phone;
        private List<UserShop> shopgoods;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public List<UserShop> getShopgoods() {
            return shopgoods;
        }

        public void setShopgoods(List<UserShop> shopgoods) {
            this.shopgoods = shopgoods;
        }
    }

    public class UserShop{
        private String code;
        private double price;
        private String title;
        private int num;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public int getNum() {
            return num;
        }

        public void setNum(int num) {
            this.num = num;
        }
    }

}
